package com.huibeili.web.controller.promotion;


import com.huibeili.member.domain.UmsMember;
import com.huibeili.member.service.IUmsMemberService;
import com.huibeili.util.BaseResponse;
import com.huibeili.util.PageHelper;
import com.huibeili.web.utils.AdminLoginUtils;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author 汇贝力商城
 * @date 2019-06-19 11:01
 * <p>
 * 分销会员控制器
 */
@RestController
@Api(description = "分销会员接口")
public class SpreadCustomerController {

    /**
     * 会员服务接口
     */
    @Autowired
    private IUmsMemberService customerService;


    /**
     * 分页查询有下级的会员信息
     *
     * @param pageHelper 分页帮助类
     * @return 会员列表
     */
    @GetMapping("/spreadcustomer")
    @ApiOperation(value = "分页查询有下级的会员信息", notes = "分页查询有下级的会员信息（需要认证）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "form", dataType = "int", name = "pageNum", value = "当前页"),
            @ApiImplicitParam(paramType = "form", dataType = "int", name = "pageSize", value = "每页显示的记录数"),
    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "会员列表", response = UmsMember.class)
    })
    public BaseResponse querySpreadCustomerList(@ApiIgnore PageHelper<UmsMember> pageHelper) {
        return BaseResponse.build(customerService.querySpreadCustomerList(pageHelper, AdminLoginUtils.getInstance().getStoreId()));
    }


}
